package com.example.demo.utils.result;


/**
 * @description: 常用结果的枚举
 * @date: 2023/1/6 22:16
 * @author: yaoshubin
 * @version: 1.0
 */

public enum ResultEnum implements IResult {

    SUCCESS(200, "接口调用成功"),
    VALIDATE_FAILED(99, "参数校验失败"),
    COMMON_FAILED(500, "服务内部异常"),
    FORBIDDEN(403, "没有权限访问资源");

    private Integer code;
    private String message;

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    ResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
